package com.example.redcultural;

import android.graphics.Color;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

public class Videos extends AppCompatActivity {
ListView listView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().setStatusBarColor(Color.argb(30, 255, 255, 255));
        }

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
            getWindow().setNavigationBarColor(Color.WHITE);

        getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
                View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR |
                View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR |
                View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_videos);
        listView=findViewById(R.id.listView_video);
        String[] title={"潇湘馆：鹦鹉吟诗","秋爽斋：探春结社","滴翠亭：宝钗扑蝶","芦雪广：白雪红梅",
                "稻香村：李纨赏花","宋词经典-开篇","词乐与词体","燕乐与词的兴盛",
                "燕乐曲辞","词的性质与功能","词体的形式特征","词乐词体讨论"};
        String[] url={"https://video.xuexi.cn/video/1005/p/ec7a7c168e51149c818911bbadf9b9bc-3bae5387e2094ef7ae5ca69a76eb28a5-2.mp4","https://video.xuexi.cn/video/1005/p/b0de3f1011d97a6c651ee3f230e26db9-dc1377bdaabf4271bd717565d4d60b9d-2.mp4",
                "https://video.xuexi.cn/video/1005/p/113351738bb288fee0eef93e6fd1d91c-f4345a5d0ff74ea8a796c9b660fa02d5-2.mp4",
                "https://video.xuexi.cn/video/1005/p/ec6daf372f035e8433f003f3725a42a6-8697698f807c4efb94ae71118493bb1a-2.mp4",
                "https://video.xuexi.cn/video/1005/p/1e7de5b5b64d5d61e4c877cd1bf35708-0a2e31e289d8425394c3ff9da302d430-2.mp4",
                "https://video.xuexi.cn/video/1005/p/acc5a28b3e2f41a8440272a971238a4a-24bf5681ed744b80a5bbe0f0250ad2de-2.mp4",
                "https://video.xuexi.cn/video/1005/p/058beb898e94cccc79df12a1eeac226d-758f6711003f4f6982e4cd631d5069ae-2.mp4",
                "https://video.xuexi.cn/video/1005/p/b6a8eb3530d9ec5b1c23ef6f42a3683f-e2cc4fd909504512b48dc70f6900c0d4-2.mp4",
                "https://video.xuexi.cn/video/1005/p/e2adb5bb1c15d3e3f80ac089eef48af2-a4598f83faca4a8aa7b3303eac0127f4-2.mp4",
                "https://video.xuexi.cn/video/1005/p/04656e0a3f2caeeec777e59ee4f0922d-307bc24c0e004ce9898b6ebf8e0781bd-2.mp4",
                "https://video.xuexi.cn/video/1005/p/3bfe97b13516273e872535373a34aa86-fc6cd7f882ce4810a2f6c816b0de5fc5-2.mp4",
                "https://video.xuexi.cn/video/1005/p/9c31c6fcf2db423eaefddaa82e2bb996-cac1a35ae1b140069bcd5758a296dc35-2.mp4"};
        List<StudyContent> studyContents = new ArrayList<>();
        for (int i = 0; i < url.length; i++) {
            StudyContent studyContent = new StudyContent();
            studyContent.setTitle(title[i]);
            studyContent.setVideoUrl(url[i]);
            studyContents.add(studyContent);
        }
        listView.setAdapter(new video_Adapter(this, studyContents));
    }
}
